<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>添加销售价格单</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../elementUI/index.css">
  <link rel="stylesheet" href="../../../css/index.css">
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :model="form" ref="contract" :rules="rules" inline-message="true" style="width: 100%">
      <div class="table_titel">
        <div class="titel">分账管理</div>
      </div>
      <el-descriptions :column="4" border size="small">
        <el-descriptions-item label="待分账金额">
          <el-form-item prop="TotalAmount">
            <el-input type="Number" v-model="form.TotalAmount" placeholder="请输入总金额"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="付款账户">
          <el-form-item prop="Account">
            <el-input type="Number" v-model="form.Account" placeholder="请输入账号"></el-input>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>

      <div>
        <div class="table_titel">
          <div class="titel">供应商信息</div>
          <div class="operation">
            <el-button type="primary" size="small" @click="add_sales_unitprice_detail">新增</el-button>
            <el-button type="danger" size="small" @click="remove_sales_unitprice_detail">删除</el-button>
          </div>
        </div>
        <el-descriptions :column="2" border size="small" v-for="(item,index) in form.Children.sales_unitprice_detail"
          :key="index">
          <el-descriptions-item label="供应商名称">
            <el-form-item :rules="Supplier_SerialNumber"
              :prop="'Children.sales_unitprice_detail. '+ index +'.Supplier_SerialNumber '">
              <el-select v-model.trim="item.Supplier_SerialNumber" placeholder="请选择供应商" filterable style="width: 100%">
                <el-option v-for="(item,index) in supplier" :key="index" :label="item.Supplier_Name"
                  :value="item.Supplier_SerialNumber"></el-option>
              </el-select>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="结算日期">
            <el-date-picker v-model="item.EndDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item label="分配比例">
            <el-form-item :rules="AllocationRatio"
              :prop="'Children.sales_unitprice_detail. '+ index +'.AllocationRatio '">
              <el-input v-model.trim="item.AllocationRatio" placeholder="请输入百分比"></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="收款账户">
            <el-form-item prop="CollectionAccount">
              <el-input v-model.trim="item.CollectionAccount" type="Number" placeholder="请输入收款账户"></el-input>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
      </div>

      <div style="margin-bottom: 100px;">
        <div class="table_titel">
          <div class="titel">门店信息</div>
          <div class="operation">
            <el-button type="primary" size="small" @click="add_sales_unitprice_storescope">新增</el-button>
            <el-button type="danger" size="small" @click="remove_sales_unitprice_storescope">删除</el-button>
          </div>
        </div>
        <el-descriptions :column="2" border size="small"
          v-for="(item,index) in form.Children.sales_unitprice_storescope" :key="index">
          <el-descriptions-item label="门店名称">
            <el-form-item prop="Store_SerialNumber">
              <el-select v-model.trim="item.Store_SerialNumber" placeholder="请选择店铺" filterable style="width: 100%">
                <el-option v-for="(item,index) in store" :key="index" :label="item.Store_Name"
                  :value="item.Store_SerialNumber"></el-option>
              </el-select>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="结算日期">
            <el-date-picker v-model="item.EndDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-descriptions-item>
          <el-descriptions-item label="分配比例">
            <el-form-item prop="AllocationRatio">
              <el-input v-model.trim="item.AllocationRatio" placeholder="请输入百分比"></el-input>
            </el-form-item>
          </el-descriptions-item>
          <el-descriptions-item label="收款账户">
            <el-form-item prop="CollectionAccount">
              <el-input type="Number" v-model.trim="item.CollectionAccount" placeholder="请输入收款账户"></el-input>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
      </div>
      <el-form-item class="form-operation">
        <el-button @click="window.history.back()">返回</el-button>
        <!-- <el-button type="success" @click="onExcel">导入</el-button> -->
        <el-button type="primary" :loading="loading" @click="submitForm('contract')">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
  <script type="text/javascript" src="../../../js/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../js/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../js/vue.min.js"></script>
  <script type="text/javascript" src="../../../elementUI/index.js"></script>
  <script type="text/javascript" src="../../../js/utils.js"></script>
  <script type="text/javascript" src="../../../js/ID_Validity.js"></script>
  <script type="text/javascript" src="../../../js/FileSaver.min.js"></script>
  <script type="text/javascript" src="../../../js/FileSaver.js"></script>
  <script type="text/javascript" src="../../../js/xlsx.full.min.js"></script>
  <script type="text/javascript" src="./js/Add.js"></script>
</body>

</html>